<?php
/**
 * Created by PhpStorm.
 * User: changyifan
 * Date: 2018/4/13
 * Time: 上午11:16
 */

namespace Home\Dao;
use Think\Model\BaseDao;

class TeachingclassDao extends BaseDao{
    protected $_map = array(
        'tme_boss'                    => 'tme_id',
//        'edit_teachingclass_id'     => 'tc_id',
        'teachingclass_name'        => 'tc_name',
        'start'                     => 'tc_strdate',
        'end'                       => 'tc_enddate',
        'teachingclass_intro'       => 'tc_intro',
        'set_tme_id'                => 'tme_id',
        'set_tc_id'                 => 'tc_id',
        'set_start'                 => 'tc_strdate',
        'set_end'                   => 'tc_enddate',
        'delete_tc_id'              => 'tc_id',
    );

    protected $_validate = array(
        array('tme_id','0','请选择教学方案',0,'notequal'),
        array('tc_name','require','授课班名称不能为空'),
        array('tc_strdate','require','请选择开始日期'),
        array('tc_enddate','require','请选择结束日期'),
        array('tc_intro','0','请选择教师状态',0,'notequal'),
    );
    protected $_auto =  array(
        array('tea_id','getCurrentTeaId',3,'function'),  // 新增的时候把status字段设置为1
    );
}